package extended

import (
	"jvm/nzpJvm/instructions/base"
	"jvm/nzpJvm/runtime_area"
)

// 宽索引的goto指令，用于跳转到更远的偏移量
type GOTO_W struct {
	offset int
}

// goto指令的操作数就是两个字节，宽索引就应该是32个字节
func (self *GOTO_W)FetchOperands(reader *base.BytecodeReader)  {
	self.offset = int(reader.ReadInt32())
}

// 无条件跳转
func (self *GOTO_W) Execute(frame *runtime_area.Frame) {
	base.Branch(frame, self.offset)
}
